﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.user.corp
{
    public partial class Corp_new : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

       

        protected void odsCorpInfo_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
        {
            ((Entity.CorpInfo)e.InputParameters[0]).UserName = Page.User.Identity.Name;
           // odsCorpInfo.InsertParameters["UserName"].DefaultValue = Page.User.Identity.Name;
        }
        protected void dtvCorp_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
        {

            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                e.KeepInInsertMode = true;
                //Response.Write("<script>alert('未能添加成功，请稍候再试！')</script>");
                //Response.Write("<script>alert('"+e.Exception.Message+"')</script>");
            }
            else
            {
                Response.Write("<script>alert('添加成功')</script>");
                Response.Redirect("index.aspx");
            }
        }
    }
}
